using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Resources;

using ClassBuilderWizard.Interfaces;

namespace ClassBuilderWizard
{
    internal class DALBuilder
    {
        private DatabaseObject _DbObject;
        private Parameters _Parameters;

        public DALBuilder(DatabaseObject dbo, Parameters pars)
        {
            this._DbObject = dbo;
            this._Parameters = pars;
        }

        public string GetDALClassBody()
        {
            string result = this._DbObject.DataAccessTemplate;

            result = result.Replace("[!output SAFE_NAMESPACE_NAME]", this._Parameters.ProjectNamespace);
            result = result.Replace("[!output CLASS_DEFINITION]", this._DbObject.DataAccessClassDefinition);
            result = result.Replace("[!output SAFE_CLASS_NAME]", this._Parameters.NewItemName);

            return result;
        }
    }
}
